﻿@model CategoryModel

<div class="panel-body">
    @(Html.LocalizedEditor<CategoryModel, CategoryLocalizedModel>("category-name-localized",
    @<div>
         <div class="form-group">
              <div class="col-md-3">
                  <nop-label asp-for="@Model.Locales[item].Name" />
              </div>
              <div class="col-md-9">
                  <nop-editor asp-for="@Model.Locales[item].Name" />
                  <span asp-validation-for="@Model.Locales[item].Name"></span>
              </div>
         </div>
         <div class="form-group">
              <div class="col-md-3">
                  <nop-label asp-for="@Model.Locales[item].Description" />
              </div>
              <div class="col-md-9">
                  <nop-editor asp-for="@Model.Locales[item].Description" asp-template="RichEditor" />
                  <span asp-validation-for="@Model.Locales[item].Description"></span>
              </div>
         </div>
         <input type="hidden" asp-for="@Model.Locales[item].LanguageId" />
    </div>
    ,
    @<div>
        <div class="form-group">
            <div class="col-md-3">
                <nop-label asp-for="Name" />
            </div>
            <div class="col-md-9">
                <nop-editor asp-for="Name" asp-required="true" />
                <span asp-validation-for="Name"></span>
            </div>
        </div>
        <div class="form-group">
            <div class="col-md-3">
                <nop-label asp-for="Description" />
            </div>
            <div class="col-md-9">
                <nop-editor asp-for="Description" asp-template="RichEditor" />
                <span asp-validation-for="Description"></span>
            </div>
        </div>
    </div>))

    <div class="form-group">
        <div class="col-md-3">
            <nop-label asp-for="ParentCategoryId" />
        </div>
        <div class="col-md-9">
            <nop-select asp-for="ParentCategoryId" asp-items="Model.AvailableCategories" />
            <span asp-validation-for="ParentCategoryId"></span>
        </div>
    </div>
    <div class="form-group advanced-setting">
        <div class="col-md-3">
            <nop-label asp-for="PictureId" />
        </div>
        <div class="col-md-9">
            <nop-editor asp-for="PictureId" />
            <span asp-validation-for="PictureId"></span>
        </div>
    </div>

    <!--scripts -->
    <script>
        $(document).ready(function () {
            $("#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)").click(togglePageSize);
            togglePageSize();
        });

        function togglePageSize() {
            if ($('#@Html.IdFor(model => model.AllowCustomersToSelectPageSize)').is(':checked')) {
                $('#pnlPageSize').hide();
                $('#pnlPageSizeOptions').show();
            } else {
                $('#pnlPageSize').show();
                $('#pnlPageSizeOptions').hide();
            }
        }
    </script>


</div>
